package com.example.demo.service.impl;

import com.example.demo.domain.UrlConfig;
import com.example.demo.enums.StatusEnum;
import com.example.demo.repository.UrlConfigRepository;
import com.example.demo.service.UrlConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author zhengmf
 * @Date 2018/12/27  17:41
 */
@Service
@Transactional
public class UrlConfigServiceImpl implements UrlConfigService {
    @Autowired
    private UrlConfigRepository urlConfigRepository;

    @Override
    public void saveUrlConfig(UrlConfig urlConfig) {
        urlConfigRepository.save(urlConfig);
    }

    @Override
    public void updateStatus(Long id) {
        urlConfigRepository.updateStatus(id, StatusEnum.D.name());
    }
}
